var e = require("../../../@babel/runtime/helpers/interopRequireDefault"), t = e(require("../../../@babel/runtime/regenerator")), a = require("../../../@babel/runtime/helpers/toConsumableArray"), r = require("../../../@babel/runtime/helpers/asyncToGenerator"), i = e(require("../../../utils/api"));

Page({
    data: {
        tip: "下拉刷新更多内容",
        pageNum: 1,
        pageSize: 9,
        list: [],
        more: !0
    },
    getList: function() {
        var e = this;
        return r(t.default.mark(function r() {
            var s, n, u;
            return t.default.wrap(function(t) {
                for (;;) switch (t.prev = t.next) {
                  case 0:
                    return s = wx.getStorageSync("openid"), t.prev = 1, t.next = 4, i.default.record({
                        openid: s,
                        scoreTypes: "1",
                        pageNum: e.data.pageNum,
                        pageSize: e.data.pageSize
                    });

                  case 4:
                    n = t.sent, (u = e.data.list).push.apply(u, a(n.result.list)), e.setData({
                        list: u
                    }), n.result.list.length < e.data.pageSize && e.setData({
                        more: !1,
                        tip: "没有更多了"
                    }), t.next = 14;
                    break;

                  case 11:
                    t.prev = 11, t.t0 = t.catch(1), console.log(t.t0.msg);

                  case 14:
                  case "end":
                    return t.stop();
                }
            }, r, null, [ [ 1, 11 ] ]);
        }))();
    },
    onLoad: function(e) {
        this.getList();
    },
    onReachBottom: function() {
        this.data.more && (this.setData({
            pageNum: ++this.data.pageNum
        }), this.getList());
    }
});